#!/bin/sh
set -e

echo "Starting PDB update: `date`"

for dist in 10.2-gcc3.3 10.3 10.4 10.5; do
	./refresh $dist
done

./fix_permissions.sh

echo "Refreshing section list"
if [ -f finksql ]; then
  ./finksql < sections.sql
else
  $HOME/bin/finksql < sections.sql
fi

echo "Restarting memcached"

sudo /etc/init.d/memcached restart || :

echo "Finished PDB update: `date`"

exit 0
